package com.example.wanbaqian.adapter;

import android.content.Context;
import android.view.View;

import com.example.wanbaqian.R;
import com.example.wanbaqian.bean.ApplyTwoBean;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;
import com.zhy.autolayout.utils.AutoUtils;

import java.util.List;

/**
 * Created by Administrator on 2017/7/6 0006.
 * 再次申请适配器
 */

public class ApplyAgainAdapter extends CommonAdapter<ApplyTwoBean> {
    public ApplyAgainAdapter(Context context, List<ApplyTwoBean> datas) {
        super(context, R.layout.item_apply_two_item, datas);
    }

    @Override
    public void onViewHolderCreated(ViewHolder holder, View itemView) {
        super.onViewHolderCreated(holder, itemView);
        AutoUtils.autoSize(itemView);
    }

    @Override
    protected void convert(ViewHolder holder, ApplyTwoBean applyTwoBean, int position) {
        holder.setBackgroundRes(R.id.item_apply_twoIv, applyTwoBean.getDrawableId())
                .setText(R.id.item_apply_twoTvTitle, applyTwoBean.getTitle())
                .setText(R.id.item_apply_twoTvHint, applyTwoBean.getHint())
                .setTextColorRes(R.id.item_apply_twoTvStat, applyTwoBean.getStat().equals("0") ? R.color.colorTextBlack : R.color.colorBackground)
                .setText(R.id.item_apply_twoTvStat, applyTwoBean.getStat().equals("0")? "未完善(必填)" : "已完善")
                .setVisible(R.id.bc_hint, false)
        ;
    }
}
